<template>
  <el-container style="height: 100vh;">
    <!-- 侧边栏 -->
    <SideMenu />
    <!-- 主体内容容器 -->
    <el-container direction="vertical" class="main-content">
      <!-- 顶栏 -->
      <el-header class="layout-el-header">
        <TopHeader />
      </el-header>
      <!-- 主体 -->
      <el-main class="layout-main">
        <router-view></router-view>
      </el-main>
      <!-- 底部 -->
      <el-footer class="layout-footer">
        <Footer />
      </el-footer>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import SideMenu from "../components/sidemenu/SideMenu.vue";
import TopHeader from "../components/nerbar/TopHeader.vue";
import Footer from "../components/footer/index.vue"
</script>

<style scoped>
.el-container {
  background-color: #f9f9f9;
}

.main-content {
  width: 100%;
  overflow: hidden;
}

.layout-el-header {
  margin: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 添加阴影 */
  z-index: 1000; /* 确保顶部悬浮 */
  background-color: #ffffff; /* 白色背景 */
}

.layout-main {
  padding: 20px; /* 增加内边距 */
  background-color: #f2f2f2;
  flex: 1; /* 自动填充剩余空间 */
  overflow-y: auto; /* 允许垂直滚动 */
}

.layout-footer {
  background-color: #ffffff; /* 统一底色 */
  border-top: 1px solid #e4e4e4; /* 添加上边框 */
  text-align: center;
  color: #666666;
  font-size: 14px;
}
</style>
